package com.mergeades.chp06;

import java.util.HashMap;
import java.util.UUID;

public class HashMapDeadLock {

    public static void main(String[] args) throws InterruptedException {
        final HashMap<String, String> hashMap = new HashMap<>(2);
        Thread t = new Thread(() -> {
            for (int i = 0; i < 1000000; i++) {
                new Thread(() -> hashMap.put(UUID.randomUUID().toString(), ""), "ftf" + i).start();
            }
        });

        t.start();
        t.join();
    }
}
